<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%agent}}".
 *
 * @property int $id
 * @property string $agent_name 名称
 * @property string $phone 电话
 * @property string $workplace 单位
 */
class AgentModel extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%agent}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['agent_name', 'workplace'], 'string', 'max' => 50],
            [['phone'], 'string', 'max' => 20],
            [['agent_name'], 'required'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'agent_name' => '名称',
            'phone' => '电话',
            'workplace' => '单位',
        ];
    }
}
